﻿Public Class Form1
    ' in the name of god
    '.....................
    ' بنام یگانه خالق هستی
    '
    'برنامه تبدیل اسم به ابجد 
    '       نسخه 1-1
    ' برنامه نویس: شهریاری
    '.....................

    Function get_abjad(ByVal nam As String) As Integer
        Dim g As Integer
        For Each i As Char In nam
            Select Case i
                Case "آ", "ا"
                    g += 1
                Case "ب"
                    g += 2
                Case "ج"
                    g += 3
                Case "د"
                    g += 4
                Case "ه"
                    g += 5
                Case "و"
                    g += 6
                Case "ز"
                    g += 7
                Case "ح"
                    g += 8
                Case "ط"
                    g += 9
                Case "ی"
                    g += 10
                Case "ک"
                    g += 20
                Case "ل"
                    g += 30
                Case "م"
                    g += 40
                Case "ن"
                    g += 50
                Case "س"
                    g += 60
                Case "ع"
                    g += 70
                Case "ف"
                    g += 80
                Case "ص"
                    g += 90
                Case "ق"
                    g += 100
                Case "ر"
                    g += 200
                Case "ش"
                    g += 300
                Case "ت"
                    g += 400
                Case "ث"
                    g += 500
                Case "خ"
                    g += 600
                Case "ذ"
                    g += 700
                Case "ض"
                    g += 800
                Case "ظ"
                    g += 900
                Case "غ"
                    g += 1000
                Case "پ"
                    g += 0
                Case "گ"
                    g += 0
                Case "چ"
                    g += 0
                Case "ژ"
                    g += 0
                Case Else
                    g += 0
            End Select
        Next
        Return g
    End Function

    Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
        TextBox2.Text = get_abjad(TextBox1.Text)
    End Sub
End Class
